import { UploadFileParams } from '@/utils/axios/types';
import { upload } from '@/utils/request';
import { UploadApiResult } from './model/uploadModel';

enum Api {
	UPLOAD_IMG = '/smartgr-admin/shrqsysimg/filesupload',
}

export function uploadImg(params: UploadFileParams, onUploadProgress: (progressEvent: ProgressEvent) => void) {
	return upload<UploadApiResult>(
		{
			url: Api.UPLOAD_IMG,
			onUploadProgress,
		},
		params,
	);
}
